﻿using Bll;
using Help;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Myproject.BSM.Ashx.PcChannel
{
    /// <summary>
    /// ImgAdd 的摘要说明
    /// </summary>
    public class ImgAdd : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string Slideid = context.Request.QueryString["Slideid"];
            string url = context.Request.QueryString["url"];
            ImgModel model = new ImgModel();
            model.WebSlideID = int.Parse(Slideid);
            model.ImgTitle = "";
            model.ImgUrl = url;
            if (new ImgBLL().Add(model)>0)
            {
                context.Response.Write(ReturnJsonHelp.OutHandlerJson(true, "新增成功！"));
            }
            else
            {
                context.Response.Write(ReturnJsonHelp.OutHandlerJson(false, "新增失败！"));
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}